<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Doxygen: pcl::VectorAverage&lt; real, dimension &gt; 模板类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Doxygen
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'搜索','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('classpcl_1_1_vector_average.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pro-attribs">Protected 属性</a> &#124;
<a href="classpcl_1_1_vector_average-members.html">所有成员列表</a>  </div>
  <div class="headertitle">
<div class="title">pcl::VectorAverage&lt; real, dimension &gt; 模板类 参考<div class="ingroups"><a class="el" href="group__common.html">Common components</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>Calculates the weighted average and the covariance matrix  
 <a href="classpcl_1_1_vector_average.html#details">更多...</a></p>

<p><code>#include &lt;<a class="el" href="vector__average_8h_source.html">vector_average.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:a5f45f4ae052617a2ba6b8f726780347b"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1_vector_average.html#a5f45f4ae052617a2ba6b8f726780347b">VectorAverage</a> ()</td></tr>
<tr class="separator:a5f45f4ae052617a2ba6b8f726780347b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a379f0f0a0718487d9373f603e7ca30d3"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1_vector_average.html#a379f0f0a0718487d9373f603e7ca30d3">~VectorAverage</a> ()</td></tr>
<tr class="separator:a379f0f0a0718487d9373f603e7ca30d3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5cebc1187b3b605d972d07b509467cab"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1_vector_average.html#a5cebc1187b3b605d972d07b509467cab">reset</a> ()</td></tr>
<tr class="separator:a5cebc1187b3b605d972d07b509467cab"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af301d1b1c35ce778bdc37f078c8fbe35"><td class="memItemLeft" align="right" valign="top">const Eigen::Matrix&lt; real, dimension, 1 &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1_vector_average.html#af301d1b1c35ce778bdc37f078c8fbe35">getMean</a> () const</td></tr>
<tr class="separator:af301d1b1c35ce778bdc37f078c8fbe35"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adf6b89dba922cb2a746bd853e5ee8551"><td class="memItemLeft" align="right" valign="top">const Eigen::Matrix&lt; real, dimension, dimension &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1_vector_average.html#adf6b89dba922cb2a746bd853e5ee8551">getCovariance</a> () const</td></tr>
<tr class="separator:adf6b89dba922cb2a746bd853e5ee8551"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a84cc265c145c757044b83eaae7bd034e"><td class="memItemLeft" align="right" valign="top">real&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1_vector_average.html#a84cc265c145c757044b83eaae7bd034e">getAccumulatedWeight</a> () const</td></tr>
<tr class="separator:a84cc265c145c757044b83eaae7bd034e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa4247de7da2c1d3b80762c6123c62d30"><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1_vector_average.html#aa4247de7da2c1d3b80762c6123c62d30">getNoOfSamples</a> ()</td></tr>
<tr class="separator:aa4247de7da2c1d3b80762c6123c62d30"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4baf3e577114982e97f6f9a41affaa79"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1_vector_average.html#a4baf3e577114982e97f6f9a41affaa79">add</a> (const Eigen::Matrix&lt; real, dimension, 1 &gt; &amp;sample, real weight=1.0)</td></tr>
<tr class="separator:a4baf3e577114982e97f6f9a41affaa79"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a468b99fac0cff4eaed8121df1b643de7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1_vector_average.html#a468b99fac0cff4eaed8121df1b643de7">doPCA</a> (Eigen::Matrix&lt; real, dimension, 1 &gt; &amp;eigen_values, Eigen::Matrix&lt; real, dimension, 1 &gt; &amp;eigen_vector1, Eigen::Matrix&lt; real, dimension, 1 &gt; &amp;eigen_vector2, Eigen::Matrix&lt; real, dimension, 1 &gt; &amp;eigen_vector3) const</td></tr>
<tr class="separator:a468b99fac0cff4eaed8121df1b643de7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abb781a9f490486fb46ed0f28e409feeb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1_vector_average.html#abb781a9f490486fb46ed0f28e409feeb">doPCA</a> (Eigen::Matrix&lt; real, dimension, 1 &gt; &amp;eigen_values) const</td></tr>
<tr class="separator:abb781a9f490486fb46ed0f28e409feeb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa3f5e476a123c3c42b8c982027f161a9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1_vector_average.html#aa3f5e476a123c3c42b8c982027f161a9">getEigenVector1</a> (Eigen::Matrix&lt; real, dimension, 1 &gt; &amp;eigen_vector1) const</td></tr>
<tr class="separator:aa3f5e476a123c3c42b8c982027f161a9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3bd898b04fcde21d8db5472c536da39f"><td class="memItemLeft" align="right" valign="top"><a id="a3bd898b04fcde21d8db5472c536da39f"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>doPCA</b> (Eigen::Matrix&lt; float, 3, 1 &gt; &amp;eigen_values, Eigen::Matrix&lt; float, 3, 1 &gt; &amp;eigen_vector1, Eigen::Matrix&lt; float, 3, 1 &gt; &amp;eigen_vector2, Eigen::Matrix&lt; float, 3, 1 &gt; &amp;eigen_vector3) const</td></tr>
<tr class="separator:a3bd898b04fcde21d8db5472c536da39f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7229e906c869bd5434c4079d76ced8b1"><td class="memItemLeft" align="right" valign="top"><a id="a7229e906c869bd5434c4079d76ced8b1"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>doPCA</b> (Eigen::Matrix&lt; float, 3, 1 &gt; &amp;eigen_values) const</td></tr>
<tr class="separator:a7229e906c869bd5434c4079d76ced8b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad22447a69114cd62629cfc902e34baab"><td class="memItemLeft" align="right" valign="top"><a id="ad22447a69114cd62629cfc902e34baab"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>getEigenVector1</b> (Eigen::Matrix&lt; float, 3, 1 &gt; &amp;eigen_vector1) const</td></tr>
<tr class="separator:ad22447a69114cd62629cfc902e34baab"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a05166cc6f98c88d224a33917488070d5"><td class="memItemLeft" align="right" valign="top"><a id="a05166cc6f98c88d224a33917488070d5"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>doPCA</b> (Eigen::Matrix&lt; double, 3, 1 &gt; &amp;eigen_values, Eigen::Matrix&lt; double, 3, 1 &gt; &amp;eigen_vector1, Eigen::Matrix&lt; double, 3, 1 &gt; &amp;eigen_vector2, Eigen::Matrix&lt; double, 3, 1 &gt; &amp;eigen_vector3) const</td></tr>
<tr class="separator:a05166cc6f98c88d224a33917488070d5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af50a57bc9eca79215e300506f1a9e510"><td class="memItemLeft" align="right" valign="top"><a id="af50a57bc9eca79215e300506f1a9e510"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>doPCA</b> (Eigen::Matrix&lt; double, 3, 1 &gt; &amp;eigen_values) const</td></tr>
<tr class="separator:af50a57bc9eca79215e300506f1a9e510"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa8039263eed243683fb973a2ee3f3148"><td class="memItemLeft" align="right" valign="top"><a id="aa8039263eed243683fb973a2ee3f3148"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>getEigenVector1</b> (Eigen::Matrix&lt; double, 3, 1 &gt; &amp;eigen_vector1) const</td></tr>
<tr class="separator:aa8039263eed243683fb973a2ee3f3148"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected 属性</h2></td></tr>
<tr class="memitem:ac2d6c3e82d7ec0d8a77a63bd2d8537cd"><td class="memItemLeft" align="right" valign="top"><a id="ac2d6c3e82d7ec0d8a77a63bd2d8537cd"></a>
unsigned int&#160;</td><td class="memItemRight" valign="bottom"><b>noOfSamples_</b></td></tr>
<tr class="separator:ac2d6c3e82d7ec0d8a77a63bd2d8537cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a40aa519a1631c18e349f9656a9906830"><td class="memItemLeft" align="right" valign="top"><a id="a40aa519a1631c18e349f9656a9906830"></a>
real&#160;</td><td class="memItemRight" valign="bottom"><b>accumulatedWeight_</b></td></tr>
<tr class="separator:a40aa519a1631c18e349f9656a9906830"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a257275ed8c1e3d22c22abe981087d2e4"><td class="memItemLeft" align="right" valign="top"><a id="a257275ed8c1e3d22c22abe981087d2e4"></a>
Eigen::Matrix&lt; real, dimension, 1 &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>mean_</b></td></tr>
<tr class="separator:a257275ed8c1e3d22c22abe981087d2e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a392d93a62f5b499a8a045e48e28afb74"><td class="memItemLeft" align="right" valign="top"><a id="a392d93a62f5b499a8a045e48e28afb74"></a>
Eigen::Matrix&lt; real, dimension, dimension &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>covariance_</b></td></tr>
<tr class="separator:a392d93a62f5b499a8a045e48e28afb74"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><h3>template&lt;typename real, int dimension&gt;<br />
class pcl::VectorAverage&lt; real, dimension &gt;</h3>

<p>Calculates the weighted average and the covariance matrix </p>
<p>A class to calculate the weighted average and the covariance matrix of a set of vectors with given weights. The original data is not saved. Mean and covariance are calculated iteratively. </p><dl class="section author"><dt>作者</dt><dd>Bastian Steder </dd></dl>
</div><h2 class="groupheader">构造及析构函数说明</h2>
<a id="a5f45f4ae052617a2ba6b8f726780347b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5f45f4ae052617a2ba6b8f726780347b">&#9670;&nbsp;</a></span>VectorAverage()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename real , int dimension&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classpcl_1_1_vector_average.html">pcl::VectorAverage</a>&lt; real, dimension &gt;::<a class="el" href="classpcl_1_1_vector_average.html">VectorAverage</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Constructor - dimension gives the size of the vectors to work with. </p>
<div class="fragment"><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;                                                 :</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;    noOfSamples_ (0), accumulatedWeight_ (0), </div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;    mean_ (Eigen::Matrix&lt;real, dimension, 1&gt;::Identity ()),</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;    covariance_ (Eigen::Matrix&lt;real, dimension, dimension&gt;::Identity ())</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;  {</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;    <a class="code" href="classpcl_1_1_vector_average.html#a5cebc1187b3b605d972d07b509467cab">reset</a>();</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;  }</div>
<div class="ttc" id="aclasspcl_1_1_vector_average_html_a5cebc1187b3b605d972d07b509467cab"><div class="ttname"><a href="classpcl_1_1_vector_average.html#a5cebc1187b3b605d972d07b509467cab">pcl::VectorAverage::reset</a></div><div class="ttdeci">void reset()</div><div class="ttdef"><b>Definition:</b> vector_average.hpp:53</div></div>
</div><!-- fragment -->
</div>
</div>
<a id="a379f0f0a0718487d9373f603e7ca30d3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a379f0f0a0718487d9373f603e7ca30d3">&#9670;&nbsp;</a></span>~VectorAverage()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename real , int dimension&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classpcl_1_1_vector_average.html">pcl::VectorAverage</a>&lt; real, dimension &gt;::~<a class="el" href="classpcl_1_1_vector_average.html">VectorAverage</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Destructor </p>
<div class="fragment"><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;{}</div>
</div><!-- fragment -->
</div>
</div>
<h2 class="groupheader">成员函数说明</h2>
<a id="a4baf3e577114982e97f6f9a41affaa79"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4baf3e577114982e97f6f9a41affaa79">&#9670;&nbsp;</a></span>add()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename real , int dimension&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classpcl_1_1_vector_average.html">pcl::VectorAverage</a>&lt; real, dimension &gt;::add </td>
          <td>(</td>
          <td class="paramtype">const Eigen::Matrix&lt; real, dimension, 1 &gt; &amp;&#160;</td>
          <td class="paramname"><em>sample</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">real&#160;</td>
          <td class="paramname"><em>weight</em> = <code>1.0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Add a new sample </p>
<div class="fragment"><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;                                                                                                            {</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    <span class="keywordflow">if</span> (weight == 0.0f)</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;      <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160; </div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    ++noOfSamples_;</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    accumulatedWeight_ += weight;</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    real alpha = weight/accumulatedWeight_;</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160; </div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    Eigen::Matrix&lt;real, dimension, 1&gt; diff = sample - mean_;</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    covariance_ = (covariance_ + (diff * diff.transpose())*alpha)*(1.0f-alpha);</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160; </div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;    mean_ += (diff)*alpha;</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160; </div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    <span class="comment">//if (pcl_isnan(covariance_(0,0)))</span></div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    <span class="comment">//{</span></div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;      <span class="comment">//cout &lt;&lt; PVARN(weight);</span></div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;      <span class="comment">//exit(0);</span></div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    <span class="comment">//}</span></div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;  }</div>
</div><!-- fragment -->
</div>
</div>
<a id="abb781a9f490486fb46ed0f28e409feeb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abb781a9f490486fb46ed0f28e409feeb">&#9670;&nbsp;</a></span>doPCA() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename real , int dimension&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classpcl_1_1_vector_average.html">pcl::VectorAverage</a>&lt; real, dimension &gt;::doPCA </td>
          <td>(</td>
          <td class="paramtype">Eigen::Matrix&lt; real, dimension, 1 &gt; &amp;&#160;</td>
          <td class="paramname"><em>eigen_values</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Do Principal component analysis </p>
<div class="fragment"><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;  {</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;    <span class="comment">// The following step is necessary for cases where the values in the covariance matrix are small</span></div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;    <span class="comment">// In this case float accuracy is nor enough to calculate the eigenvalues and eigenvectors.</span></div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    <span class="comment">//Eigen::Matrix&lt;double, dimension, dimension&gt; tmp_covariance = covariance_.template cast&lt;double&gt;();</span></div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;    <span class="comment">//Eigen::SelfAdjointEigenSolver&lt;Eigen::Matrix&lt;double, dimension, dimension&gt; &gt; ei_symm(tmp_covariance, false);</span></div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    <span class="comment">//eigen_values = ei_symm.eigenvalues().template cast&lt;real&gt;();</span></div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160; </div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    Eigen::SelfAdjointEigenSolver&lt;Eigen::Matrix&lt;real, dimension, dimension&gt; &gt; ei_symm(covariance_, <span class="keyword">false</span>);</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;    eigen_values = ei_symm.eigenvalues();</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;  }</div>
</div><!-- fragment -->
</div>
</div>
<a id="a468b99fac0cff4eaed8121df1b643de7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a468b99fac0cff4eaed8121df1b643de7">&#9670;&nbsp;</a></span>doPCA() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename real , int dimension&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classpcl_1_1_vector_average.html">pcl::VectorAverage</a>&lt; real, dimension &gt;::doPCA </td>
          <td>(</td>
          <td class="paramtype">Eigen::Matrix&lt; real, dimension, 1 &gt; &amp;&#160;</td>
          <td class="paramname"><em>eigen_values</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Eigen::Matrix&lt; real, dimension, 1 &gt; &amp;&#160;</td>
          <td class="paramname"><em>eigen_vector1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Eigen::Matrix&lt; real, dimension, 1 &gt; &amp;&#160;</td>
          <td class="paramname"><em>eigen_vector2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Eigen::Matrix&lt; real, dimension, 1 &gt; &amp;&#160;</td>
          <td class="paramname"><em>eigen_vector3</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Do Principal component analysis </p>
<div class="fragment"><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;  {</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    <span class="comment">// The following step is necessary for cases where the values in the covariance matrix are small</span></div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    <span class="comment">// In this case float accuracy is nor enough to calculate the eigenvalues and eigenvectors.</span></div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    <span class="comment">//Eigen::Matrix&lt;double, dimension, dimension&gt; tmp_covariance = covariance_.template cast&lt;double&gt;();</span></div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    <span class="comment">//Eigen::SelfAdjointEigenSolver&lt;Eigen::Matrix&lt;double, dimension, dimension&gt; &gt; ei_symm(tmp_covariance);</span></div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;    <span class="comment">//eigen_values = ei_symm.eigenvalues().template cast&lt;real&gt;();</span></div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    <span class="comment">//Eigen::Matrix&lt;real, dimension, dimension&gt; eigen_vectors = ei_symm.eigenvectors().template cast&lt;real&gt;();</span></div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160; </div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;    <span class="comment">//cout &lt;&lt; &quot;My covariance is \n&quot;&lt;&lt;covariance_&lt;&lt;&quot;\n&quot;;</span></div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    <span class="comment">//cout &lt;&lt; &quot;My mean is \n&quot;&lt;&lt;mean_&lt;&lt;&quot;\n&quot;;</span></div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;    <span class="comment">//cout &lt;&lt; &quot;My Eigenvectors \n&quot;&lt;&lt;eigen_vectors&lt;&lt;&quot;\n&quot;;</span></div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160; </div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    Eigen::SelfAdjointEigenSolver&lt;Eigen::Matrix&lt;real, dimension, dimension&gt; &gt; ei_symm(covariance_);</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    eigen_values = ei_symm.eigenvalues();</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    Eigen::Matrix&lt;real, dimension, dimension&gt; eigen_vectors = ei_symm.eigenvectors();</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160; </div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    eigen_vector1 = eigen_vectors.col(0);</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    eigen_vector2 = eigen_vectors.col(1);</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    eigen_vector3 = eigen_vectors.col(2);</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;  }</div>
</div><!-- fragment -->
</div>
</div>
<a id="a84cc265c145c757044b83eaae7bd034e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a84cc265c145c757044b83eaae7bd034e">&#9670;&nbsp;</a></span>getAccumulatedWeight()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename real , int dimension&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">real <a class="el" href="classpcl_1_1_vector_average.html">pcl::VectorAverage</a>&lt; real, dimension &gt;::getAccumulatedWeight </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Get the summed up weight of all added vectors </p>
<div class="fragment"><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;{ <span class="keywordflow">return</span> accumulatedWeight_;}</div>
</div><!-- fragment -->
</div>
</div>
<a id="adf6b89dba922cb2a746bd853e5ee8551"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adf6b89dba922cb2a746bd853e5ee8551">&#9670;&nbsp;</a></span>getCovariance()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename real , int dimension&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const Eigen::Matrix&lt;real, dimension, dimension&gt;&amp; <a class="el" href="classpcl_1_1_vector_average.html">pcl::VectorAverage</a>&lt; real, dimension &gt;::getCovariance </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Get the covariance matrix of the added vectors </p>
<div class="fragment"><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;{ <span class="keywordflow">return</span> covariance_;}</div>
</div><!-- fragment -->
</div>
</div>
<a id="aa3f5e476a123c3c42b8c982027f161a9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa3f5e476a123c3c42b8c982027f161a9">&#9670;&nbsp;</a></span>getEigenVector1()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename real , int dimension&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classpcl_1_1_vector_average.html">pcl::VectorAverage</a>&lt; real, dimension &gt;::getEigenVector1 </td>
          <td>(</td>
          <td class="paramtype">Eigen::Matrix&lt; real, dimension, 1 &gt; &amp;&#160;</td>
          <td class="paramname"><em>eigen_vector1</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Get the eigenvector corresponding to the smallest eigenvalue </p>
<div class="fragment"><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;  {</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;    <span class="comment">// The following step is necessary for cases where the values in the covariance matrix are small</span></div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;    <span class="comment">// In this case float accuracy is nor enough to calculate the eigenvalues and eigenvectors.</span></div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;    <span class="comment">//Eigen::Matrix&lt;double, dimension, dimension&gt; tmp_covariance = covariance_.template cast&lt;double&gt;();</span></div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;    <span class="comment">//Eigen::SelfAdjointEigenSolver&lt;Eigen::Matrix&lt;double, dimension, dimension&gt; &gt; ei_symm(tmp_covariance);</span></div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;    <span class="comment">//eigen_values = ei_symm.eigenvalues().template cast&lt;real&gt;();</span></div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;    <span class="comment">//Eigen::Matrix&lt;real, dimension, dimension&gt; eigen_vectors = ei_symm.eigenvectors().template cast&lt;real&gt;();</span></div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160; </div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;    <span class="comment">//cout &lt;&lt; &quot;My covariance is \n&quot;&lt;&lt;covariance_&lt;&lt;&quot;\n&quot;;</span></div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;    <span class="comment">//cout &lt;&lt; &quot;My mean is \n&quot;&lt;&lt;mean_&lt;&lt;&quot;\n&quot;;</span></div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    <span class="comment">//cout &lt;&lt; &quot;My Eigenvectors \n&quot;&lt;&lt;eigen_vectors&lt;&lt;&quot;\n&quot;;</span></div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160; </div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;    Eigen::SelfAdjointEigenSolver&lt;Eigen::Matrix&lt;real, dimension, dimension&gt; &gt; ei_symm(covariance_);</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;    Eigen::Matrix&lt;real, dimension, dimension&gt; eigen_vectors = ei_symm.eigenvectors();</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;    eigen_vector1 = eigen_vectors.col(0);</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;  }</div>
</div><!-- fragment -->
</div>
</div>
<a id="af301d1b1c35ce778bdc37f078c8fbe35"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af301d1b1c35ce778bdc37f078c8fbe35">&#9670;&nbsp;</a></span>getMean()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename real , int dimension&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const Eigen::Matrix&lt;real, dimension, 1&gt;&amp; <a class="el" href="classpcl_1_1_vector_average.html">pcl::VectorAverage</a>&lt; real, dimension &gt;::getMean </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Get the mean of the added vectors </p>
<div class="fragment"><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;{ <span class="keywordflow">return</span> mean_;}</div>
</div><!-- fragment -->
</div>
</div>
<a id="aa4247de7da2c1d3b80762c6123c62d30"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa4247de7da2c1d3b80762c6123c62d30">&#9670;&nbsp;</a></span>getNoOfSamples()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename real , int dimension&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">unsigned int <a class="el" href="classpcl_1_1_vector_average.html">pcl::VectorAverage</a>&lt; real, dimension &gt;::getNoOfSamples </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Get the number of added vectors </p>
<div class="fragment"><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;{ <span class="keywordflow">return</span> noOfSamples_;}</div>
</div><!-- fragment -->
</div>
</div>
<a id="a5cebc1187b3b605d972d07b509467cab"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5cebc1187b3b605d972d07b509467cab">&#9670;&nbsp;</a></span>reset()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename real , int dimension&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classpcl_1_1_vector_average.html">pcl::VectorAverage</a>&lt; real, dimension &gt;::reset</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Reset the object to work with a new data set </p>
<div class="fragment"><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;  {</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;    noOfSamples_ = 0;</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    accumulatedWeight_ = 0.0;</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    mean_.fill(0);</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    covariance_.fill(0);</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;  }</div>
</div><!-- fragment -->
</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>common/include/pcl/common/<a class="el" href="vector__average_8h_source.html">vector_average.h</a></li>
<li>common/include/pcl/common/impl/<a class="el" href="vector__average_8hpp_source.html">vector_average.hpp</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><b>pcl</b></li><li class="navelem"><a class="el" href="classpcl_1_1_vector_average.html">VectorAverage</a></li>
    <li class="footer">制作者 <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
